function addLoadEvent(func) {
    let oldonload = window.onload;
    if(typeof oldonload != 'function') {
        window.onload = func;
    // console.log("enter load ")
    } else {
        window.onload = function() {
            oldonload();
            func();
        }   
     }
}